projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54fc98e
)
(decode_coding_emacs_mule): Handle insufficent source correctly.
author
Kenichi Handa
<handa@m17n.org>
Tue, 9 Mar 2004 12:27:04 +0000
(12:27 +0000)
committer
Kenichi Handa
<handa@m17n.org>
Tue, 9 Mar 2004 12:27:04 +0000
(12:27 +0000)
src/coding.c
patch
|
blob
|
history
diff --git
a/src/coding.c
b/src/coding.c
index 62c761c5bcf863af5dcf8c3cede426c10efbc1a7..76ef3026a2d1ee6357fc33a51050347a04b31476 100644
(file)
--- a/
src/coding.c
+++ b/
src/coding.c
@@
-1024,9
+1024,26
@@
decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
}
else
{
- bytes = CHAR_STRING (*src, tmp);
- p = tmp;
+ int i, c;
+
+ bytes = BYTES_BY_CHAR_HEAD (*src);
src++;
+ for (i = 1; i < bytes; i++)
+ {
+ ONE_MORE_BYTE (c);
+ if (CHAR_HEAD_P (c))
+ break;
+ }
+ if (i < bytes)
+ {
+ bytes = CHAR_STRING (*src_base, tmp);
+ p = tmp;
+ src = src_base + 1;
+ }
+ else
+ {
+ p = src_base;
+ }
}
if (dst + bytes >= (dst_bytes ? dst_end : src))
{